-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document debug logging. #5671
Document debug logging. #5671
Conversation
} else { | ||
log(task, queue, "failed in ${formatDuration(elapsedNs)}") | ||
log(task, queue, "failed a run in ${formatDuration(elapsedNs)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
carefully chosen words to get the right width!
OkHttp has internal APIs to enable debug logging. It uses the `java.util.logging` API which can be | ||
tricky to configure. As a shortcut, you can paste [OkHttpDebugLogging.kt]. Then enable debug logging | ||
for whichever features you need: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth a sentence on Android, example logcat filter etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. Turns out hooking up logcat to java.util.Logging nicely is a bit of a pain if you want to use FINE
!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Good idea though!)
Nice user friendly change! |
37d3663
to
a2f0fe7
Compare
Also refine the formatting of TaskRunner logging. Before: [2019-12-30 16:43:19] Q1 starting: OkHttp ConnectionPool [2019-12-30 16:43:19] Q1 scheduled after 300 s: OkHttp ConnectionPool [2019-12-30 16:43:19] Q1 finished in 94 µs: OkHttp ConnectionPool [2019-12-30 16:43:19] Q359 scheduled after 0 µs: OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:19] Q359 starting: OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:19] Q361 schedule canceled (queue is shutdown): OkHttp www.youtube.com onSettings [2019-12-30 16:43:19] Q359 finished in 382 µs: OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:20] Q1 scheduled after 0 µs: OkHttp ConnectionPool [2019-12-30 16:43:20] Q365 scheduled after 0 µs: OkHttp android-developers.googleblog.com applyAndAckSettings [2019-12-30 16:43:20] Q1 starting: OkHttp ConnectionPool [2019-12-30 16:43:20] Q365 starting: OkHttp android-developers.googleblog.com applyAndAckSettings [2019-12-30 16:43:20] Q1 scheduled after 300 s: OkHttp ConnectionPool [2019-12-30 16:43:20] Q1 finished in 151 µs: OkHttp ConnectionPool After: [2019-12-30 16:43:19] Q10001 starting : OkHttp ConnectionPool [2019-12-30 16:43:19] Q10001 run again after 300 s : OkHttp ConnectionPool [2019-12-30 16:43:19] Q10001 finished run in 94 µs: OkHttp ConnectionPool [2019-12-30 16:43:19] Q10359 scheduled after 0 µs: OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:19] Q10359 starting : OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:19] Q10361 schedule canceled (queue is shutdown): OkHttp www.youtube.com onSettings [2019-12-30 16:43:19] Q10359 finished run in 382 µs: OkHttp www.youtube.com applyAndAckSettings [2019-12-30 16:43:20] Q10001 scheduled after 0 µs: OkHttp ConnectionPool [2019-12-30 16:43:20] Q10365 scheduled after 0 µs: OkHttp android-developers.googleblog.com applyAndAckSettings [2019-12-30 16:43:20] Q10001 starting : OkHttp ConnectionPool [2019-12-30 16:43:20] Q10365 starting : OkHttp android-developers.googleblog.com applyAndAckSettings [2019-12-30 16:43:20] Q10001 run again after 300 s : OkHttp ConnectionPool [2019-12-30 16:43:20] Q10001 finished run in 151 µs: OkHttp ConnectionPool
a2f0fe7
to
a815093
Compare
Also refine the formatting of TaskRunner logging.
Before:
After: